<!DOCTYPE html>
<html>
<head>
    <title>客户订单</title>
		<#include "/header.html">
		<script src="${request.contextPath}/statics/js/common.js"></script>
		<link rel="stylesheet" href="${request.contextPath}/statics/css/businessbill.css">
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showList">
        <div class="grid-btn">
			<#if shiro.hasPermission("erp:businessbill:save")>
            <a class="btn btn-primary" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</a>
			</#if>
			<#if shiro.hasPermission("erp:businessbill:update")>
            <a class="btn btn-primary" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
			</#if>
			<#if shiro.hasPermission("erp:businessbill:delete")>
            <a class="btn btn-primary" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
			</#if>
        </div>
        <table id="jqGrid"></table>
        <div id="jqGridPager"></div>
    </div>

    <div v-show="!showList" class="panel panel-default">
        <div class="panel-heading">{{title}}</div>
        <form class="form-horizontal-bill">
        <form id="dingdanInfo" class="">
        <table class="bill-info-table">
        	<tr>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">订单编号</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.billCode" placeholder="订单编号"/> -->
                            <span>{{businessBill.billCode}}</span>
                        </div>
                    </div>
        		</td>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">订单日期</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.billDate" placeholder="订单日期"/> -->
							<span>{{businessBill.billDate}}</span>
<!--                              <div class="block"> -->
<!-- 							    <el-date-picker -->
<!-- 							      v-model="billDateStr" -->
<!-- 							      type="date" -->
<!-- 							      placeholder="选择日期"> -->
<!-- 							    </el-date-picker> -->
<!-- 							  </div> -->
                        </div>
                    </div>
        		</td>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">客户编码</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.customerCode" placeholder="客户编码"/> -->
							<span>{{businessBill.customerCode}}</span>
<!--                             <el-select v-model="customerCode" @change="vm.changeCustomer()" filterable placeholder="请选择"> -->
<!-- 							    <el-option -->
<!-- 							      v-for="item in customerList" -->
<!-- 							      :key="item.customerCode" -->
<!-- 							      :label="item.customerCode" -->
<!-- 							      :value="item.customerCode"> -->
<!-- 							    </el-option> -->
<!-- 							  </el-select> -->
							<span>{{businessBill.customerName}}</span>
<!-- 							  <el-select v-model="customerCode" @change="vm.changeCustomer()" filterable placeholder="请选择"> -->
<!-- 							    <el-option -->
<!-- 							      v-for="item in customerList" -->
<!-- 							      :key="item.customerCode" -->
<!-- 							      :label="item.customerName" -->
<!-- 							      :value="item.customerCode"> -->
<!-- 							    </el-option> -->
<!-- 							  </el-select> -->
                        </div>
                    </div>
        		</td>
        	</tr>
        	<tr>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">送货地点</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="customerVO.deliveryAddress" placeholder="送货地点"/> -->
                            <span>{{businessBill.deliveryAddress}}</span>
                        </div>
                    </div>
        		</td>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">送货部门</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="customerVO.deliveryPart" placeholder="送货部门"/> -->
                             <span>{{businessBill.deliveryPart}}</span>
                        </div>
                    </div>
        		</td>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">客户PO</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.customerPo" placeholder="客户PO"/> -->
                            <span>{{businessBill.customerPo}}</span>
                        </div>
                    </div>
        		</td>
        	</tr>
        	<tr>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">付款期</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.paymentMethod" placeholder="付款期"/> -->
							<span>{{businessBill.paymentMethod}}</span>
<!-- 							<el-select v-model="paymentMethod" placeholder="请选择"> -->
<!-- 							    <el-option -->
<!-- 							      v-for="item in paymentMethodOptions" -->
<!-- 							      :key="item.paramValue" -->
<!-- 							      :label="item.paramType" -->
<!-- 							      :value="item.paramValue"> -->
<!-- 							    </el-option> -->
<!-- 							  </el-select> -->
                        </div>
                    </div>
        		</td>
        		<td>
        			<div class="form-group-bill">
                        <div class="col-sm-2 control-label">货币</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.currencyType" placeholder="货币"/> -->
							<span>{{businessBill.currencyType}}</span>
<!--                             <el-select v-model="currencyType" placeholder="请选择"> -->
<!-- 							    <el-option -->
<!-- 							      v-for="item in currencyTypeOptions" -->
<!-- 							      :key="item.paramValue" -->
<!-- 							      :label="item.paramType" -->
<!-- 							      :value="item.paramValue"> -->
<!-- 							    </el-option> -->
<!-- 							  </el-select> -->
                        </div>
                    </div>
        		</td>
        		<td>
        			
        		</td>
        	</tr>
        </table>
        </form>
        
        <hr style="filter: alpha(opacity=100,finishopacity=0,style=3)" width="80%" color="#987cb9" size="3"/>
        
		<el-row>
		  <el-col :span="12">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label my-col-1">客方货号</div>
                        <div class="col-sm-10 my-col-12">
<!--                             <input type="text" class="form-control" v-model="businessBill.customerGoodsCode" placeholder="客方货号"/> -->
							<el-autocomplete
							      popper-class="my-autocomplete"
							      v-model="customerGoodsCode"
							      :fetch-suggestions="querySearch"
							      placeholder="请输入内容"
							      @select="handleSelect"
							      class="cgc-select"
							    >
							    
							       <template slot-scope="{ item }">
							       		<div class="el-select-dropdown__item">
				                          	<div class="select-opt-3" >{{ item.customerGoodsCode }}</div>
				                            <div class="select-opt-5" >{{ item.boxCode }}</div>
				                            <div class="select-opt-5" >{{ item.paperCode }}</div>
				                            <div class="select-opt-10" >{{ item.paperLong }}</div>
				                            <div class="select-opt-10" >{{ item.paperWide }}</div>
				                            <div class="select-opt-10" >{{ item.paperHeight }}</div>
				                        </div>
								  </template>
							    </el-autocomplete>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="12">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label my-col-1">盒式</div>
                        <div class="col-sm-10 my-col-12">
<!--                             <input type="text" class="form-control" v-model="businessBill.boxCode" placeholder="盒式"/> -->
                            <el-select v-model="boxCode" @change="changeBoxInfo(boxCodeVO);" placeholder="请选择">
							    <el-option
							      v-for="item in boxCodeList"
							      :key="item.boxInfoId"
							      :label="item.boxName"
							      :value="item.boxCode">
							      <span style="float: left">{{ item.boxName }}</span>
							      <span style="float: right; color: #8492a6; font-size: 13px">{{ item.boxCode }}</span>
							    </el-option>
							  </el-select>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">啤模编号</div>
                        <div class="col-sm-10 pimo-select">
                            <el-select v-model="pimoCode" placeholder="请选择">
	                            <li class="el-select-dropdown__item">
		                          	<div class="select-opt-3" >编码</div>
		                            <div class="select-opt-5" >名称</div>
		                            <div class="select-opt-5" >用料宽</div>
		                            <div class="select-opt-5" >用料长</div>
		                            <div class="select-opt-10" >单位</div>
		                        </li>
							    <el-option
							      v-for="item in pimoCodeList"
							      :key="item.pimoInfoId"
							      :label="item.pimoName"
							      :value="item.pimoCode">
							      <div class="select-opt-3">{{ item.pimoCode }}</div>
							      <div class="select-opt-5">{{ item.pimoName }}</div>
							      <div class="select-opt-5">{{ item.usePaperWeigth }}</div>
							      <div class="select-opt-5">{{ item.usePaperLong }}</div>
							      <div class="select-opt-10">{{ item.unitType }}</div>
							    </el-option>
							  </el-select>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">纸质</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.paperCode" placeholder="纸质"/> -->
                            <el-select v-model="paperCode" @change="changePaperCodeEv" placeholder="请选择">
                            	<li class="el-select-dropdown__item">
		                          	<div class="select-opt-3" >纸质</div>
		                            <div class="select-opt-3" >纸质类别</div>
		                            <div class="select-opt-3" >重量</div>
		                        </li>
							    <el-option
							      v-for="item in paperCodeList"
							      :key="item.paperInfoId"
							      :label="item.paperName"
							      :value="item.paperCode">
		                          	<div class="select-opt-3">{{ item.paperCode }}</div>
		                            <div class="select-opt-3">{{ item.paperType }}</div>
		                            <div class="select-opt-3">{{ item.paperWeight }}</div>
							    </el-option>
							  </el-select>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">调整纸质</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.changePaperCode" placeholder="调整纸质"/> -->
                            <el-select v-model="changePaperCode" placeholder="请选择">
<!-- 							    <el-option -->
<!-- 							      v-for="item in paperCodeList" -->
<!-- 							      :key="item.paperInfoId" -->
<!-- 							      :label="item.paperName" -->
<!-- 							      :value="item.paperCode"> -->
<!-- 							      <span >{{ item.paperCode }}</span> -->
<!-- 							      <span >{{ item.paperType }}</span> -->
<!-- 							      <span >{{ item.paperWeight }}</span> -->
<!-- 							    </el-option> -->
							    <li class="el-select-dropdown__item">
		                          	<div class="select-opt-3" >纸质</div>
		                            <div class="select-opt-3" >纸质类别</div>
		                            <div class="select-opt-3" >重量</div>
		                        </li>
							    <el-option
							      v-for="item in paperCodeList"
							      :key="item.paperInfoId"
							      :label="item.paperName"
							      :value="item.paperCode">
		                          	<div class="select-opt-3">{{ item.paperCode }}</div>
		                            <div class="select-opt-3">{{ item.paperType }}</div>
		                            <div class="select-opt-3">{{ item.paperWeight }}</div>
							    </el-option>
							  </el-select>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">长</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" @change="calculateFormula" v-model="paperLong" placeholder="长"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">宽</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" @change="calculateFormula" v-model="paperWide" placeholder="宽"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">高</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" @change="calculateFormula" v-model="paperHeight" placeholder="高"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">调长</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" @change="calculateFormula" v-model="changeLong" placeholder="调长"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">调宽</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" @change="calculateFormula" v-model="changeWide" placeholder="调宽"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">调高</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" @change="calculateFormula" v-model="changeHeight" placeholder="调高"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">单位</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.paperUnite" placeholder="单位"/> -->
                            <el-select v-model="unitType" @change="vm.changeUnit()" placeholder="请选择">
							    <el-option
							      v-for="item in unitTypeOptions"
							      :key="item.paramValue"
							      :label="item.paramValue"
							      :value="item.paramValue">
							     	 <span style="float: left">{{ item.paramValue }}</span>
                                  	 <span style="float: right; color: #8492a6; font-size: 13px">{{ item.attr1 }}</span>
							    </el-option>
							  </el-select>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">钉口</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.dingKou" placeholder="钉口"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill" style="display:none;">
                        <div class="col-sm-2 control-label">送货时间</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.deliberyTime" placeholder="送货时间"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">配件</div>
                        <div class="col-sm-10">
<!--                             <input type="text" class="form-control" v-model="businessBill.peiJian" placeholder="配件"/> -->
                            <el-checkbox v-model="peiJian"></el-checkbox>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">数量</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" @change="calculateTotalPrice" v-model="businessBill.totalNum" placeholder="数量"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">备品数</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.bkNum" placeholder="备品数"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">包装数</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.packageNum" placeholder="包装数"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">单价</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="price" placeholder="单价"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">金额</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="totalPrice" placeholder="金额"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">单重</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="weight" placeholder="单重"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">面积</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="area" placeholder="面积"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">生产备注</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.productRemark" placeholder="生产备注"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">供应商</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.supplierCode" placeholder="供应商"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">备注</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.remark" placeholder="备注"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">特殊规格</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.specialRemark" placeholder="特殊规格"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>	
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">备注1</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.remark1" placeholder="备注1"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">备注2</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.remark2" placeholder="备注2"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">料一</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.useOne" placeholder="料一"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>
		<el-row>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">料二</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.useTwo" placeholder="料二"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">插接口</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.insertInterface" placeholder="插接口"/>
                        </div>
                    </div>
		  </el-col>
		  <el-col :span="8">
		  	<div class="form-group-bill">
                        <div class="col-sm-2 control-label">厚度</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.thickSize" placeholder="厚度"/>
                        </div>
                    </div>
		  </el-col>
		</el-row>									                    
											                    <div class="form-group-bill" style="display:none;">
                        <div class="col-sm-2 control-label">有效标识（1：有效0：无效）</div>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" v-model="businessBill.status=1" placeholder="有效标识（1：有效0：无效）"/>
                        </div>
                    </div>
							            <div class="form-group-bill">
                <div class="col-sm-2 control-label"></div>
                <input type="button" class="btn btn-primary" @click="saveOrUpdate" value="确定"/>
                &nbsp;&nbsp;<input type="button" class="btn btn-warning" @click="callbackBT" value="返回"/>
            </div>
        </form>
    </div>
</div>

<script src="${request.contextPath}/statics/js/modules/erp/businessbill.js?_${.now?long}"></script>
</body>
</html>